// eslint-disable-next-line
import { UserLayout, BasicRawLayout, PageRawView, } from '@/layouts';
import { RouteRecordRaw } from 'vue-router';
import uuid from 'node-uuid';
// 动态路由（一般是后台返回的路由）
const asyncRouterMap: Array<RouteRecordRaw> = [
    {
        path: '/',
        name: uuid.v4(),
        component: BasicRawLayout,
        redirect: '/workbench',
        meta: { title: 'workbench' },
        children: [
            {
                path: '/workbench',
                name: uuid.v4(),
                component: () => import('@/views/workbench/index.vue'),
                meta: { title: '工作台', icon: 'icongongzuotai', isHide: false, keepAlive: true }
            },
            {
                path: '/workbench/todoList',
                name: uuid.v4(),
                component: () => import('@/views/workbench/dashboard/todoList.vue'),
                meta: { title: '待办列表', icon: 'icongongzuotai', isHide: true }
            },
            {
                path: '/workbench/taskBoard',
                name: uuid.v4(),
                component: () => import('@/views/workbench/dashboard/taskBoard.vue'),
                meta: { title: '受理进度', icon: 'icongongzuotai', isHide: true }
            },
            {
                path: '/workbench/versionBoard',
                name: uuid.v4(),
                component: () => import('@/views/workbench/dashboard/versionBoard.vue'),
                meta: { title: '研发进度', icon: 'icongongzuotai', isHide: true }
            },
            {
                path: '/createMultiRequire',
                name: uuid.v4(),
                component: () => import('@/views/createMultiRequire/index.vue'),
                meta: { title: '批量创建需求', icon: 'iconyewuxuqiu', isHide: true }
            },
            {
                path: '/taskRequire',
                name: uuid.v4(),
                component: PageRawView,
                redirect: '/taskRequire/myRequire',
                meta: { title: '业务需求', icon: 'iconyewuxuqiu', isHide: false, requireAuth: true },
                children: [
                    {
                        path: '/taskRequire/myRequire',
                        name: uuid.v4(),
                        component: () => import('@/views/taskRequire/taskList/myRequire/index.vue'),
                        meta: { title: '我的需求', isHide: false, keepAlive: true, requireAuth: true }
                    },
                    {
                        path: '/sendRequire/createTaskRequire',
                        name: uuid.v4(),
                        component: () => import('@/views/taskRequire/createTaskRequire/index.vue'),
                        meta: { title: '创建业务需求', isHide: true }
                    },
                    {
                        path: '/sendRequire/createMultiTaskRequire',
                        name: uuid.v4(),
                        redirect: '/createMultiRequire',
                        meta: { title: '批量创建业务需求', isHide: true, requireAuth: true }
                    },
                    {
                        path: '/taskRequire/taskDetail',
                        name: uuid.v4(),
                        component: () => import('@/views/taskRequire/taskDetail/index.vue'),
                        meta: { title: '详情', isHide: true }
                    },
                    {
                        path: '/taskRequire/taskRequirements',
                        name: uuid.v4(),
                        component: () => import('@/views/taskRequire/taskList/taskRequirements/index.vue'),
                        meta: { title: '业务需求池', isHide: false, keepAlive: true, requireAuth: true }
                    }
                ]
            },
            {
                path: '/productRequire',
                name: uuid.v4(),
                component: PageRawView,
                redirect: '/productRequire/myRequire',
                meta: { title: '产品需求', icon: 'iconchanyanxuqiu', isHide: false, requireAuth: true },
                children: [
                    {
                        path: '/productRequire/myRequire',
                        name: uuid.v4(),
                        component: () => import('@/views/productRequire/productList/myRequire/index.vue'),
                        meta: { title: '我的需求', isHide: false, keepAlive: true, requireAuth: true }
                    },
                    {
                        path: '/sendRequire/createProductRequire',
                        name: uuid.v4(),
                        component: () => import('@/views/productRequire/createProductRequire/index.vue'),
                        meta: { title: '创建产品需求', isHide: true, requireAuth: true }
                    },
                    {
                        path: '/sendRequire/createMultiProRequire',
                        name: uuid.v4(),
                        redirect: '/createMultiRequire',
                        meta: { title: '批量创建产品需求', isHide: true, requireAuth: true }
                    },
                    {
                        path: '/productRequire/productRequirements',
                        name: uuid.v4(),
                        component: () => import('@/views/productRequire/productList/productRequirements/index.vue'),
                        meta: { title: '产品需求池', isHide: false, keepAlive: true, requireAuth: true }
                    },
                    {
                        path: '/productRequire/productDetail',
                        name: uuid.v4(),
                        component: () => import('@/views/productRequire/productDetail/index.vue'),
                        meta: { title: '详情', isHide: true }
                    },
                    {
                        path: '/productRequire/startProcess',
                        name: uuid.v4(),
                        component: () => import('@/views/version/startProcess/index.vue'),
                        meta: { title: '发起评审', isHide: true }
                    }
                ]
            },
            {
                path: '/version',
                name: uuid.v4(),
                component: PageRawView,
                redirect: '/version/versionList',
                meta: { title: '预发布版本管理', icon: 'iconicon_v', isHide: false, requireAuth: true },
                children: [
                    {
                        path: '/version/versionList',
                        name: uuid.v4(),
                        component: () => import('@/views/version/versionList/index.vue'),
                        meta: { title: '版本列表', isHide: false, keepAlive: true, requireAuth: true }
                    },
                    {
                        path: '/version/versionDetail',
                        name: uuid.v4(),
                        component: () => import('@/views/version/versionDetail/index.vue'),
                        meta: { title: '预发布版本详情', isHide: true }
                    },
                    {
                        path: '/version/onlineList',
                        name: uuid.v4(),
                        component: () => import('@/views/version/onlineList/index.vue'),
                        meta: { title: '上线管理', isHide: false, keepAlive: true, requireAuth: false }
                    },

                    {
                        path: '/version/calendarList',
                        name: uuid.v4(),
                        component: () => import('@/views/version/calendarList/index.vue'),
                        meta: { title: '上线日历管理', isHide: true }
                    },
                    //兼容oa跳转
                    {
                        path: '/productRequire/versionDetail',
                        name: uuid.v4(),
                        component: () => import('@/views/productRequire/versionDetail/index.vue'),
                        meta: { title: '预发布版本详情', isHide: true }
                    },
                    {
                        path: `/${uuid.v4()}`,
                        name: uuid.v4(),
                        component: PageRawView,
                        redirect: '/energyManage/versionReportHistory',
                        meta: { title: '版本能效报告', isHide: false, isHideArrow: true },
                        children: [
                            {
                                path: '/energyManage/versionReportHistory',
                                name: uuid.v4(),
                                component: () => import('@/views/energyManage/versionReportHistory/index.vue'),
                                meta: { title: '版本能效报告', isHide: true }
                            },
                            {
                                path: `/${uuid.v4()}`,
                                name: uuid.v4(),
                                component: PageRawView,
                                redirect: '/energyManage/versionReportHistory/detail',
                                meta: { title: '能效报告详情', isHide: true },
                                children: [
                                    {
                                        path: '/energyManage/versionReportHistory/detail',
                                        name: uuid.v4(),
                                        component: () => import('@/views/energyManage/versionReportHistory/detail/index.vue'),
                                        meta: { title: '能效报告详情', isHide: true }
                                    },
                                    {
                                        path: '/energyManage/versionReportHistory/requestList',
                                        name: uuid.v4(),
                                        component: () => import('@/views/energyManage/versionReportHistory/requestList/index.vue'),
                                        meta: { title: '需求明细', isHide: true, keepAlive: true }
                                    },
                                    {
                                        path: '/energyManage/riskAnalysis',
                                        name: uuid.v4(),
                                        component: () => import('@/views/energyManage/riskAnalysis/index.vue'),
                                        meta: { title: '需求跟踪详情', isHide: true, keepAlive: true }
                                    },
                                    {
                                        path: '/energyManage/timeliness',
                                        name: uuid.v4(),
                                        component: () => import('@/views/energyManage/timeliness/index.vue'),
                                        meta: { title: '能效报告及时性详情', isHide: true, keepAlive: true }
                                    }
                                ]
                            }

                        ]
                    }
                ]
            },
            {
                path: '/lubiao',
                name: uuid.v4(),
                component: PageRawView,
                redirect: '/lubiao/list',
                meta: { title: '路标管理', icon: 'icona-11', keepAlive: true },
                children: [
                    {
                        path: '/lubiao/setting',
                        name: uuid.v4(),
                        component: () => import('@/views/lubiao/setting/index.vue'),
                        meta: { title: '路标管理设置', isHide: false, keepAlive: true, requireAuth: false }
                    },
                    {
                        path: '/lubiao/pushList',
                        name: uuid.v4(),
                        component: () => import('@/views/lubiao/pushList/index.vue'),
                        meta: { title: '任务推送', isHide: false }
                    },
                    {
                        path: '/lubiao/my',
                        name: uuid.v4(),
                        component: () => import('@/views/lubiao/my/index.vue'),
                        meta: { title: '我的路标', isHide: false }
                    }
                ]
            },
            {
                path: '/energyManage',
                name: uuid.v4(),
                component: PageRawView,
                redirect: '/energyManage/requireTrack',
                meta: { title: '能效管理', icon: 'icona-11', keepAlive: true },
                children: [
                    {
                        path: `/${uuid.v4()}`,
                        name: uuid.v4(),
                        component: PageRawView,
                        redirect: '/energyManage/beijixing',
                        meta: { title: '能效北极星指标看板', isHide: false, isHideArrow: true, keepAlive: true },
                        children: [
                            {
                                path: '/energyManage/beijixing',
                                name: uuid.v4(),
                                component: () => import('@/views/energyManage/beijixing/index.vue'),
                                meta: { title: '能效北极星指标看板', isHide: true, keepAlive: true }
                            },
                            {
                                path: '/energyManage/beijixing/detail',
                                name: uuid.v4(),
                                component: () => import('@/views/energyManage/beijixing/Detail/index.vue'),
                                meta: { title: '能效北极星指标看板详情', isHide: true, keepAlive: true }
                            },
                            {
                                path: '/energyManage/beijixing/detail/jiraTrack',
                                name: uuid.v4(),
                                component: () => import('@/views/energyManage/beijixing/track/jiraTrack.vue'),
                                meta: { title: 'jira需求跟踪矩阵', isHide: true, keepAlive: true }
                            },
                            {
                                path: '/energyManage/beijixing/detail/requireTrack',
                                name: uuid.v4(),
                                component: () => import('@/views/energyManage/beijixing/track/requireTrack.vue'),
                                meta: { title: '需求跟踪矩阵', isHide: true, keepAlive: true }
                            }
                        ]
                    },
                    {
                        path: `/${uuid.v4()}`,
                        name: uuid.v4(),
                        component: PageRawView,
                        redirect: '/energyManage/requireTrack',
                        meta: { title: '需求跟踪矩阵', isHide: false, isHideArrow: true, keepAlive: true },
                        children: [
                            {
                                path: '/energyManage/requireTrack',
                                name: uuid.v4(),
                                component: () => import('@/views/energyManage/requireTrack/index.vue'),
                                meta: { title: '需求跟踪矩阵', isHide: true, keepAlive: true }
                            },
                            {
                                path: '/energyManage/requireTrack/riskAnalysis',
                                name: uuid.v4(),
                                component: () => import('@/views/energyManage/requireTrack/riskAnalysis.vue'),
                                meta: { title: '需求跟踪矩阵详情', isHide: true, keepAlive: true }
                            }
                        ]
                    },
                    {
                        path: `/${uuid.v4()}`,
                        name: uuid.v4(),
                        component: PageRawView,
                        redirect: '/energyManage/jiraTrack',
                        meta: { title: 'jira需求跟踪矩阵', isHide: false, isHideArrow: true, keepAlive: true },
                        children: [
                            {
                                path: '/energyManage/jiraTrack',
                                name: uuid.v4(),
                                component: () => import('@/views/energyManage/jiraTrack/index.vue'),
                                meta: { title: 'jira需求跟踪矩阵', isHide: false, keepAlive: true }
                            },
                            {
                                path: '/energyManage/jiraTrack/detail',
                                name: uuid.v4(),
                                component: () => import('@/views/energyManage/jiraTrack/detail/index.vue'),
                                meta: { title: 'jira需求跟踪矩阵详情', isHide: true, keepAlive: true }
                            }
                        ]
                    },
                    {
                        path: `/${uuid.v4()}`,
                        name: uuid.v4(),
                        component: PageRawView,
                        redirect: '/energyManage/analysisReport',
                        meta: { title: '产线汇报', isHide: false, isHideArrow: true, keepAlive: true, requireAuth: true },
                        children: [
                            {
                                path: '/energyManage/analysisReport',
                                name: uuid.v4(),
                                component: () => import('@/views/energyManage/analysisReport/index.vue'),
                                meta: { title: '产线汇报', isHide: true, keepAlive: true, requireAuth: true }
                            },
                            {
                                path: '/energyManage/analysisReport/list',
                                name: uuid.v4(),
                                component: () => import('@/views/energyManage/analysisReport/list/index.vue'),
                                meta: { title: '产线汇报历史', isHide: true, keepAlive: true, requireAuth: true }
                            },
                            {
                                path: '/energyManage/analysisReport/beijixingBoard',
                                name: uuid.v4(),
                                component: () => import('@/views/energyManage/analysisReport/beijixingBoard/index.vue'),
                                meta: { title: '产线汇报预览', isHide: true, keepAlive: true, requireAuth: true }
                            },
                            {
                                path: '/energyManage/analysisReport/preview',
                                name: uuid.v4(),
                                component: () => import('@/views/energyManage/analysisReport/preview/index.vue'),
                                meta: { title: '产线汇报预览', isHide: true, keepAlive: true, requireAuth: true }
                            },
                            {
                                path: '/energyManage/analysisReport/detail',
                                name: uuid.v4(),
                                component: () => import('@/views/energyManage/analysisReport/detail/index.vue'),
                                meta: { title: '产线汇报详情', isHide: true, keepAlive: true, requireAuth: true }
                            },
                            {
                                path: '/energyManage/analysisReport/proList',
                                name: uuid.v4(),
                                component: () => import('@/views/energyManage/analysisReport/proList/index.vue'),
                                meta: { title: '详情', isHide: true, keepAlive: true, requireAuth: true }
                            },
                            {
                                path: '/energyManage/analysisReport/proDetailList',
                                name: uuid.v4(),
                                component: () => import('@/views/energyManage/analysisReport/proDetailList/index.vue'),
                                meta: { title: '产品需求明细', isHide: true, keepAlive: true, requireAuth: true }
                            },
                            {
                                path: '/energyManage/analysisReport/taskDetailList',
                                name: uuid.v4(),
                                component: () => import('@/views/energyManage/analysisReport/taskDetailList/index.vue'),
                                meta: { title: '业务需求明细', isHide: true, keepAlive: true, requireAuth: true }
                            }
                        ]
                    },
                    {
                        path: '/insideCharts/pmpAndJiraChart',
                        name: uuid.v4(),
                        component: () => import('@/views/insideCharts/pmpAndJiraChart/index.vue'),
                        meta: { title: '能效统计', isHide: false, keepAlive: true }
                    },
                    {
                        path: '/insideCharts/energyChart',
                        name: uuid.v4(),
                        component: () => import('@/views/insideCharts/energyChart/index.vue'),
                        meta: { title: '能效分析', isHide: false, keepAlive: true }
                    },
                    {
                        path: '/energyManage/userTongji',
                        name: uuid.v4(),
                        component: () => import('@/views/energyManage/userTongji/index.vue'),
                        meta: { title: '用户行为统计', isHide: false, keepAlive: true }
                    },
                    {
                        path: '/energyManage/zhipingGuifanxing',
                        name: uuid.v4(),
                        component: () => import('@/views/energyManage/zhipingGuifanxing/index.vue'),
                        meta: { title: '制品规范性', isHide: false, keepAlive: true }
                    }
                ]
            },
            {
                path: '/productAnalysis',
                name: uuid.v4(),
                component: PageRawView,
                redirect: '/productAnalysis/productList',
                meta: { title: '产品管理', icon: 'iconfenxi', isHide: false, requireAuth: true },
                children: [
                    {
                        path: '/productAnalysis/productList',
                        name: uuid.v4(),
                        component: () => import('@/views/productAnalysis/productList/index.vue'),
                        meta: { title: '产品概况', isHide: false, keepAlive: true, requireAuth: true }
                    },
                    {
                        path: '/productAnalysis/productDetail',
                        name: uuid.v4(),
                        component: () => import('@/views/productAnalysis/productDetail/index.vue'),
                        meta: { title: '产品详情', isHide: true }
                    },
                    {
                        path: '/productAnalysis/texingTree',
                        name: uuid.v4(),
                        component: () => import('@/views/productAnalysis/texingTree/index.vue'),
                        meta: { title: '特性树管理', requireAuth: true }
                    },
                    {
                        path: '/productAnalysis/texingTree/Detail',
                        name: uuid.v4(),
                        component: () => import('@/views/productAnalysis/texingTree/Detail/index.vue'),
                        meta: { title: '特性树管理详情', isHide: true, requireAuth: true }
                    },
                    {
                        path: '/productAnalysis/versionControl',
                        name: uuid.v4(),
                        component: () => import('@/views/productAnalysis/versionControl/index.vue'),
                        meta: { title: '版本管理', isHide: false, keepAlive: true }
                    }
                ]
            },
            {
                path: '/requireChange',
                name: uuid.v4(),
                component: PageRawView,
                redirect: '/requireChange/requireChangeList',
                meta: { title: '需求变更', icon: 'iconxuqiubiangeng' },
                children: [
                    {
                        path: '/requireChange/requireChangeList',
                        name: uuid.v4(),
                        component: () => import('@/views/requireChange/requireChangeList/index.vue'),
                        meta: { title: '需求变更', isHide: false, keepAlive: true }
                    },
                    {
                        path: '/requireChange/createRequireChange',
                        name: uuid.v4(),
                        component: () => import('@/views/requireChange/createRequireChange/index.vue'),
                        meta: { title: '发起变更', isHide: true }
                    },
                    {
                        path: '/requireChange/changeDetail',
                        name: uuid.v4(),
                        component: () => import('@/views/requireChange/changeDetail/index.vue'),
                        meta: { title: '需求变更评审', isHide: true }
                    }
                ]
            },
            {
                path: '/tool',
                name: uuid.v4(),
                component: PageRawView,
                redirect: '/tool/feishu',
                meta: { title: '工具', icon: 'icongongju', requireAuth: true },
                children: [
                    {
                        path: '/tool/feishu',
                        name: uuid.v4(),
                        component: () => import('@/views/tool/feishu/index.vue'),
                        meta: { title: '同步飞书', isHide: false, keepAlive: true, requireAuth: true }
                    },
                    {
                        path: `/${uuid.v4()}`,
                        name: uuid.v4(),
                        component: PageRawView,
                        redirect: '/tool/fuyongku',
                        meta: { title: '需求复用库', isHide: false, isHideArrow: true, keepAlive: true },
                        children: [
                            {
                                path: '/tool/fuyongku',
                                name: uuid.v4(),
                                component: () => import('@/views/tool/fuyongku/index.vue'),
                                meta: { title: '需求复用库', isHide: true, keepAlive: true }
                            },
                            {
                                path: '/tool/fuyongku/proDetail',
                                name: uuid.v4(),
                                component: () => import('@/views/tool/fuyongku/proDetail/index.vue'),
                                meta: { title: '需求复用库详情', isHide: true, keepAlive: true }
                            },
                            {
                                path: '/tool/fuyongku/taskDetail',
                                name: uuid.v4(),
                                component: () => import('@/views/tool/fuyongku/taskDetail/index.vue'),
                                meta: { title: '需求复用库详情', isHide: true, keepAlive: true }
                            }
                        ]
                    },
                    {
                        path: '/tool/xuqiuguanxi',
                        name: uuid.v4(),
                        component: () => import('@/views/tool/xuqiuguanxi/index.vue'),
                        meta: { title: '需求关系管理', isHide: false, keepAlive: true }
                    }
                ]
            },
            {
                path: '/setting',
                name: uuid.v4(),
                component: PageRawView,
                redirect: '/setting/templateList',
                meta: { title: '系统设置', icon: 'iconshezhi', requireAuth: true },
                children: [
                    {
                        path: '/setting/templateList',
                        name: uuid.v4(),
                        component: () => import('@/views/setting/templateList/index.vue'),
                        meta: { title: '方法模板', isHide: false, requireAuth: true }
                    },
                    {
                        path: '/setting/dicTree',
                        name: uuid.v4(),
                        component: () => import('@/views/setting/dicTree/index.vue'),
                        meta: { title: '字典树', isHide: false, requireAuth: true }
                    },
                    {
                        path: '/setting/system/systemList',
                        name: uuid.v4(),
                        component: () => import('@/views/setting/system/systemList/index.vue'),
                        meta: { title: '系统管理', isHide: false, requireAuth: true }
                    },
                    {
                        path: '/setting/system/systemDetail',
                        name: uuid.v4(),
                        component: () => import('@/views/setting/system/systemDetail/index.vue'),
                        meta: { title: '系统详情', isHide: true, requireAuth: true }
                    },
                    {
                        path: '/setting/analysisReport',
                        name: uuid.v4(),
                        component: () => import('@/views/setting/analysisReport/index.vue'),
                        meta: { title: '产线汇报设置', isHide: false, requireAuth: true }
                    }
                ]
            },

            {
                path: '/:catchAll(.*)',
                name: uuid.v4(),
                redirect: '/404',
                meta: { title: '404', isHide: true }
            }
        ]
    }
];

export { asyncRouterMap };
/**
 * 基础路由
 * @type { *[] }
 */
export const constantRouterMap: Array<RouteRecordRaw> = [
    {
        path: '/user',
        name: 'user',
        component: UserLayout,
        redirect: '/user/login',
        children: [
            {
                path: 'login',
                name: 'login',
                component: () => import('@/views/user/Login.vue')
            }
        ]
    },
    {
        path: '/GuidePc',
        name: 'GuidePc',
        component: () => import('@/views/guidePc/index.vue')
    },
    {
        path: '/404',
        name: 'Exception404',
        component: () => import('@/views/exception/404.vue')
    },
    {
        path: '/:pathMatch(.*)*',
        // name: 'NotFound',  去掉是因为name的优先级高于path，所以去掉name防止总是进入到404
        meta: { title: '404', isHide: true },
        component: () => import('@/views/exception/404.vue')
    }
];
